<style scoped>
.content .w980 {
    padding-top: 0;
}

.nav-path {
    position: relative;
}

.nav-path ol {
    width: 100%;
    height: 36px;
}

.nav-path button.add-hsp-btn {
    position: absolute;
    top: 0;
    right: 0;
}

.nav-path ol li a {
    color: #444;
}

.nav-path ol li:last-child {
    color: #00CB8F;
}


/*机构列表*/

.list-tips {
    padding: 0;
    height: 36px;
    line-height: 36px;
    background: #F5F5F4 url(../../assets/img/list_tips.png) no-repeat 20px center;
    background-size: 4px 20px;
}

.list-tips span {
    float: left;
    font-size: 16px;
    height: 36px;
    line-height: 36px;
    margin-left: 36px;
    text-align: left;
}

.list-tips span.default-span {
    color: #6C6C6C;
    font-size: 14px;
    /*padding: 0 15px;*/
    cursor: pointer;
}

.list-tips span.active-span {
    color: #fff;
    background-color: #00C484;
}

.list-tips button.close span {
    font-size: 18px;
    margin: 2px 10px 0 0;
    text-align: left;
}

.org-list .list-tips button {
    float: right;
    width: 118px;
    height: 36px;
    text-align: center;
    color: #fff;
    border-radius: 10px;
    background-color: #00A9FD;
    font-size: 16px;
    line-height: 36px;
    margin-right: 20px;
    /*margin-top: calc(50%-0.18rem);*/
    margin-top: 6px;
    outline: none;
}

.org-list .list-opera .form-inline label {
    margin: 0 10px 0 23px;
    font-size: 12px;
    color: #666460;
    font-weight: 400;
}

.org-list .list-opera .form-inline button {
    width: 98px;
    height: 32px;
    display: inline-block;
    border-radius: 16px;
}

.list-opera {
    margin: 10px 0 20px 0;
}

.list-opera .form-inline .clear-research {
    margin-left: 15px;
    height: 32px;
}

.list-content table th {
    text-align: center;
    line-height: 36px;
    height: 36px;
    font-weight: normal;
    background-color: #F8F8F7;
}

.list-content table tr:nth-child(odd) {
    background-color: #fff;
}

.list-content table tr:nth-child(even) {
    background-color: #F6FBF8;
}

.list-content table td {
    line-height: 40px;
    text-align: center;
    color: #898989;
}

.list-content table tr td:nth-child(1) {
    color: #333
}

.list-content table tr td:nth-child(2),
.list-content table tr td:nth-child(3) {
    color: #333
}

.list-content table tr td a.glyphicon {
    display: inline-block;
    padding: 0 0 0 20px;
    height: 16px;
    font-size: 12px;
    text-align: right;
    margin-right: 5px;
    text-decoration: none;
    color: #444;
    background-repeat: no-repeat!important;
    background-position: left center!important;
}

.list-content table tr td a:first-child {
    background: url(../../assets/img/edit.png);
    background-size: 14px;
}

.list-content table tr td .glyphicon:hover {
    color: #1dc499;
    cursor: pointer;
}

.list-content table tr td a:nth-child(1) {
    background: url(../../assets/img/watch.png);
    background-size: 17px 12px;
}

.list-content table tr td a:nth-child(2) {
    background: url(../../assets/img/nav.png);
    background-size: 16px;
}

.list-content table tr td a:nth-child(3) {
    background: url(../../assets/img/account.png);
    background-size: 16px;
}

.list-content table tr td a:nth-child(4) {
    background: url(../../assets/img/report-exp.png);
    background-size: 13px 16px;
}

.list-content table tr td a:nth-child(5) {
    background: url(../../assets/img/QR_code.png);
    background-size: 14px;
}

.list-content table tr td a:nth-child(6) {
    background: url(../../assets/img/dele4.png);
    background-size: 14px;
}


/*模态框基本设置*/

.modal-dialog .breadcrumb {
    margin-bottom: 0;
}

#add-org-cover .modal-body {
    height: 500px;
    overflow: auto;
    padding: 0 15px;
}


/*模态框*/

.modal-dialog {
    width: 70%;
    height: 600px;
    border-top: 0;
}

.modal-body .form-group {
    display: block;
    margin-bottom: 18px;
    margin-top: 18px;
}

.modal-body .increase-team-per select,
.modal-body .increase-team-per input {
    width: 60%;
    display: inline-block;
}

.modal-body .form-group-foot {
    text-align: center;
}

.modal-body .form-group label {
    width: 27%;
    text-align: right;
}

.modal-body .form-inline .form-control {
    width: 48%;
    text-align: left;
    text-indent: 10px;
    margin-left: 30px;
}


/*hospital Map*/

.modal-body .form-inline .list-top-title {
    vertical-align: top;
}

.modal-body .form-inline #map-container1 {
    position: relative;
}

.modal-body .form-inline .hospital-map {
    width: 90%;
    height: 400px;
    overflow: hidden;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: inline-block;
    text-align: center;
    text-indent: 10px;
    margin-left: 6%;
}

.modal-body .form-inline img {
    width: 80px;
    height: 80px;
    float: left;
    border: 0;
    text-indent: 0;
    border-radius: 10% 5%;
}

.modal-body .form-group .sim-explain-textarea {
    width: 48%;
    min-height: 122px;
    margin-left: 30px;
    overflow: auto;
    overflow-x: hidden;
    resize: none;
}

.modal-body .list-tips .team-label {
    float: left;
    height: 36px;
    line-height: 36px;
}

.modal-body .list-tips .new-per {
    float: right;
    height: 36px;
    line-height: 36px;
    color: #1AA9FD;
    margin-right: 46px;
    background: none;
}


/*信息填写不完整提示框*/

.msg-without-complete .modal-dialog {
    width: 100%;
    height: 100%;
}

.msg-without-complete .modal-content {
    width: 50%;
    text-align: center;
    font-size: 16px;
    color: #37B06C;
    line-height: 100px;
    margin: 0 auto;
    top: 50%;
    -left: 50%;
    margin-top: -50px;
}


/*删除提示*/

#delCoverTips .modal-dialog .modal-content {
    width: 90%;
    margin: 0 auto;
}

.del-tips {
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-size: 20px;
}

.del-tips span {
    color: #f00;
    padding: 0 3px;
}

.modal-footer {
    text-align: center;
    padding: 0;
}

.modal-footer .form-group.clear-margin-bot {
    margin-bottom: 0;
}

.modal-footer .btn {
    outline: none;
}

.modal-footer .btn.btn-primary {
    background-color: #00C782;
}

.modal-footer .btn-opera .form-group {
    text-align: center;
}


/*编辑服务项目*/

.form-group {
    display: block;
    margin-bottom: 18px;
}

.form-group label {
    text-align: right;
    font-weight: 400;
}

.exp-mark {
    color: red;
    height: 100%;
    line-height: 100%;
    font-size: 14px;
    margin-right: 5px;
    display: inline-block;
}

.form-group button {
    width: 136px;
    height: 36px;
    color: #FFF;
}

span.error {
    color: #f00;
}


/*查看机构*/

.check-org .check-detail .form-group {
    display: block;
    margin-bottom: 18px;
}

.check-org .check-detail .form-group label {
    width: 154px;
    font-size: 12px;
    color: #6A6966;
    margin-right: 13px;
}

.check-org .check-detail .form-group input {
    width: 478px;
    height: 30px;
    line-height: 30px;
}

.check-org .check-detail .form-group textarea {
    width: 478px;
    padding: 10px;
    height: 122px;
    overflow: auto;
    resize: none;
}

.check-org .check-detail .form-group select {
    width: 478px;
    appearance: none;
    -moz-appearance: none;
    /*?Firefox?*/
    -webkit-appearance: none;
    /*?Safari?和?Chrome?*/
    background: url(../../assets/img/select_bg.png) no-repeat 95% center;
    background-size: 11px 6px;
}

.upload-img {
    width: 80px;
    height: 80px;
    border: 0;
    display: inline-block;
}


/*上传图像按钮*/

.file-continer {
    display: inline-block;
    border: 0;
    width: 45%;
    height: 50px;
    padding: 0;
    position: relative;
    text-align: left;
    margin-left: 30px;
    /* background: url(../../assets/img/upload_img.png) no-repeat left center;
    background-size: 80px; */
}

.reupload-img-btn {
    width: 100px;
    height: 30px;
    line-height: 30px;
    position: relative;
    left: 100px;
    top: 50%;
    margin-top: -15px;
    cursor: pointer;
}

.reupload-img-btn span,
.reupload-img-btn input {
    width: 100px;
    height: 30px;
    float: left;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
}

.reupload-img-btn span {
    background: #00C484;
    font-size: 16px;
    line-height: 30px;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    text-align: center;
}

.reupload-img-btn input {
    opacity: 0;
    filter: alpha(opacity=0);
    z-index: 100;
}


/*信息填写不完整提示框*/

.msg-without-complete {
    -z-index: 10200;
}

.msg-without-complete .modal-content {
    width: 40%;
    text-align: center;
    font-size: 16px;
    color: orangered;
    line-height: 80px;
    margin: 0 auto;
    top: 50%;
    -left: 50%;
    margin-top: -50px;
}


/*所在地区*/

#area-provice,
#area-city {
    width: 22%;
}

.area-lists {
    position: relative;
}

.area-lists .area-load {
    position: absolute;
    top: 30px;
    left: 30%;
    width: 45%;
    height: 300px;
    background: pink;
    overflow: auto;
    z-index: 100;
    border-radius: 10px;
}

.area-lists .area-load ul li {
    width: 100%;
    height: 30px;
    line-height: 30px;
    font-size: 16px;
    text-align: center;
}

.area-lists .area-load ul li a span {
    font-size: 16px;
}

#tree_3 {
    width: 45%;
    left: 30%;
    height: 211px;
    overflow: auto;
}

.j-close-tree {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 16px;
    display: inline-block;
    line-height: 30px;
    cursor: pointer;
    font-size: 20px;
}


/*area-provice-city*/

.areas-box {
    width: 50%;
    display: inline-block;
    margin-left: 30px;
}

.belong-area-title {
    vertical-align: top;
}


/*模态提示*/

#delCoverTips .modal-dialog {
    width: 48%;
    margin: 0 auto;
}


/*删除服务提示*/

.del-tips {
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-size: 20px;
}

.del-tips span {
    color: #f00;
    padding: 0 3px;
}

.start {
    font-size: 14px;
    color: red
}

.imgmodal {
    padding-left: 50%;
    margin-left: -200px;
    height: 250px;
    overflow: hidden;
}

.img-tips {
    position: absolute;
    right: 0;
    top: 30%;
    font-size: 14px;
}

.del-cover {
    padding: 15px 0;
}

.text-right {
    text-align: right;
}


/*账户信息*/

.modal-body .account-content h2.account-title {
    font-size: 22px;
    background: #EEE;
    padding: 5px 5%;
}

.modal-body .account-content .form-group label {
    float: left;
}

.modal-body .account-content .form-group input {
    margin-left: 10px;
    display: inline-block;
    width: 30%;
}


/*二维码*/

#ewmimg .modal-dialog {
    width: 40%;
}

.imgmodal img {
    width: 250px;
    height: 250px;
    position: absolute;
    top: 50%;
    margin-top: -125px;
    left: 50%;
    margin-left: -125px;
}

#allmap {
    /*width: 900px;*/
    height: 400px;
    overflow: hidden;
}


/*上级机构--检索*/

#zhuguanyis {
    position: relative;
}

#zhuguanyis .yishenglist {
    position: absolute;
    display: none;
    left: 31%;
    top: 34px;
    z-index: 9;
    width: 200px;
    height: 200px;
    overflow: auto;
    -webkit-box-shadow: 0 0 10px rgba(230, 230, 230, .9);
    -moz-box-shadow: 0 0 10px rgba(230, 230, 230, .9);
    box-shadow: 0 0 10px rgba(230, 230, 230, .9);
    background: #fff;
    border-radius: 0 0 10px 10px;
    padding: 10px
}

#zhuguanyis .yishenglist p {
    line-height: 26px;
    height: 26px;
    margin-top: 5px;
    background: #f1f1f1;
    padding-left: 10px
}

#zhuguanyis .yishenglist p:nth-child(1) {
    background: #1dc499;
    color: #fff
}
</style>
<template>
    <div class="index clearafter">
        <!-- 头部组件 -->
        <header-component></header-component>
        <div class="content flex">
            <!-- 侧部导航组件 -->
            <div class="w220">
                <aside-component></aside-component>
            </div>
            <!-- 右部内容区 -->
            <div class="w980 flex_full">
                <!-- 路径导航 -->
                <nav class="nav-path">
                    <ol class="breadcrumb">
                        <li>机构管理</li>
                        <li v-if="isWatchOrg">查看机构</li>
                        <li v-if="isAddOrg">添加机构</li>
                    </ol>
                    <button class="longBtn" @click="addHospitalOrgEvent"> + 添加机构</button>
                </nav>
                <!-- 查询相关操作 -->
                <div class="list-opera">
                    <form class="form-inline">
                        <div class="form-group">
                            <label for="searchOrgByName">医院名称</label>
                            <input type="text" class="form-control" id="searchOrgByName" placeholder="输入搜索的医院名称" value="{{param.name}}" v-model="param.name" />
                        </div>
                        <div class="clear-research form-group">
                            <!-- <button class="btn btn-default clear-btn" @click.stop.prevent="clearEvent">清  除</button> -->
                            <button type="submit" class="ok default" @click.stop.prevent="researchEvent">搜 索</button>
                        </div>
                    </form>
                </div>
                <!-- 服务列表内容 -->
                <div class="list-content">
                    <table class="table table-striped">
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th class="col-lg-1">序号</th>
                                    <th class="col-lg-3">医院名称</th>
                                    <th class="col-lg-2">简称</th>
                                    <th class="col-lg-6">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="($index,lists) in serverData">
                                    <td>{{$index+1}}</td>
                                    <td>{{lists.orgFullName}}</td>
                                    <td>{{lists.orgShortName}}</td>
                                    <td>
                                        <a class="glyphicon" @click="watchAndEditEvent(lists)">查看</a>
                                        <a class="glyphicon" href="javascript:;" @click="hspNagationEvent(lists)">医院导航</a>
                                        <a class="glyphicon" @click="accountMsgEvent(lists)">账号信息</a>
                                        <a class="glyphicon" href="javascript:;" @click="hspReportEvent(lists)">报告说明</a>
                                        <a class="glyphicon" @click="watchQrCodeEvent(lists)">二维码</a>
                                        <a class="glyphicon" @click="deleteOrgEvent(lists)">删除</a>
                                    </td>
                                </tr>
                                <tr class="no-data" v-if="isData">
                                    <td colspan="4">暂无查询记录</td>
                                </tr>
                            </tbody>
                        </table>
                    </table>
                </div>
                <!-- 分页 -->
                <bootpage-component v-ref:page :async="true" :lens="lenArr" :page-len="pageLen" :param="param" :headersparam="headersparam"></bootpage-component>
            </div>
            <!--2-添加机构 -->
            <div class="check-org">
                <div id="add-org-cover" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <div class="list-tips breadcrumb">
                                    <span class="default-span">{{operaTiele}}</span>
                                    <button type="button" class="close" @click.stop.prevent="cancelAddHspEvent">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                </div>
                            </div>
                            <div class="modal-body cbafter">
                                <!-- 添加-查看-机构表单内容 -->
                                <div class="base-content" v-show="baseMsg">
                                    <form action="#" class="form-inline" id="add-hsp-org-form" action="#" enctype="multipart/form-data">
                                        <input type="hidden" name="orgId" value="{{addOrgMsg.orgId}}" />
                                        <div class="form-group">
                                            <label for="exampleInputName2"><span class="start">*</span>机构全称:</label>
                                            <input name="orgFullName" type="text" class="form-control" id="fullName" placeholder="请输入机构全称" value="{{addOrgMsg.orgFullName}}" v-model="addOrgMsg.orgFullName" :disabled="disabledIsShow" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">机构简称:</label>
                                            <input name="orgShortName" type="text" class="form-control" id="shortName" placeholder="请输入机构简称" value="{{addOrgMsg.orgShortName}}" v-model="addOrgMsg.orgShortName" :disabled="disabledIsShow" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">机构医保局ID:</label>
                                            <input name="medicalOrgId" type="text" class="form-control" id="medicalOrgId" placeholder="如：ZS278-282" value="{{addOrgMsg.medicalOrgId}}" v-model="addOrgMsg.medicalOrgId" :disabled="disabledIsShow" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2"><span class="start">*</span>机构本地代码:</label>
                                            <input name="localOrgId" type="text" class="form-control" id="localOrgId" placeholder="如：ZS278-282" value="{{addOrgMsg.localOrgId}}" v-model="addOrgMsg.localOrgId" :disabled="disabledIsShow" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2" class="list-top-title">上传图片:</label>
                                            <div class="file-continer form-control">
                                                <imgid-btn :imgurl="imgurl"></imgid-btn>
                                                <span class="img-tips">建议图片尺寸750×250(px)</span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">医院分类:</label>
                                            <select name="orgClassify" id="hospital-sort" class="form-control roles-type" :disabled="disabledIsShow" v-model="addOrgMsg.orgClassify">
                                                <option v-for="item in dictionary.orgClassify" value="{{item.key}}">{{item.text}}</option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">医院性质:</label>
                                            <select name="orgNature" id="hospital-nature" class="form-control roles-type" :disabled="disabledIsShow" v-model="addOrgMsg.orgNature">
                                                <option v-for="item in dictionary.orgNature" value="{{item.key}}">{{item.text}}</option>
                                            </select>
                                        </div>
                                        <div class="form-group" id="zhuguanyis">
                                            <label for="exampleInputName2">上级机构:</label>
                                            <input type="hidden" class="form-control" placeholder="" v-model="addOrgMsg.parentId">
                                            <input type="text" class="form-control" v-model="addOrgMsg.parentOrgName" :disabled="disabledIsShow" />
                                            <div class="yishenglist">
                                                <p @click="mayclick()">清空搜索内容</p>
                                                <p @click="mayclick(item,$event)" v-for="item in  search.orgs | filterBy addOrgMsg.parentOrgName in 'orgFullName'">{{item.orgFullName}}</p>
                                            </div>
                                            <span>(*选填)</span>
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">医院等级:</label>
                                            <select name="orgLevel" id="hospital-rank" class="form-control roles-type" :disabled="disabledIsShow" v-model="addOrgMsg.orgLevel">
                                                <option v-for="item in dictionary.orgLevel" value="{{item.key}}">{{item.text}}</option>
                                            </select>
                                        </div>
                                        <div class="form-group area-lists" v-show="showarea">
                                            <label class="belong-area-title" for="exampleInputName2"><span class="start">*</span>所属地区:</label>
                                            <div class="areas-box">
                                                <area-component :defaultarea="defaultarea"></area-component>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2"><span class="start">*</span>机构地址:</label>
                                            <input name="orgAddress" type="text" class="form-control" id="address" placeholder="请输入机构具体地址" value="{{addOrgMsg.orgAddress}}" v-model="addOrgMsg.orgAddress" :disabled="disabledIsShow" />
                                        </div>
                                        <div class="form-group" id="map-container1">
                                            <label for="exampleInputName2" class="list-top-title">医院地图:</label>
                                            <div class="hospital-map">
                                                <div id="allmap"></div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2"><span class="start">*</span>经度:</label>
                                            <input name="longitude" type="text" class="form-control" id="longitude" placeholder="如：119.221" value="{{addOrgMsg.longitude}}" v-model="addOrgMsg.longitude" :disabled="disabledIsShow" @blur="baiduMap(addOrgMsg.longitude,addOrgMsg.latitude)" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2"><span class="start">*</span>纬度:</label>
                                            <input name="latitude" type="text" class="form-control" id="latitude" placeholder="如：30.0212" value="{{addOrgMsg.latitude}}" v-model="addOrgMsg.latitude" :disabled="disabledIsShow" @blur="baiduMap(addOrgMsg.longitude,addOrgMsg.latitude)" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">咨询电话:</label>
                                            <input name="consultNo" type="text" class="form-control" id="exampleInputName2" placeholder="请输入咨询电话" value="{{addOrgMsg.consultNo}}" v-model="addOrgMsg.consultNo" :disabled="disabledIsShow" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">紧急电话:</label>
                                            <input name="emergencyNo" type="text" class="form-control" id="exampleInputName2" placeholder="请输入急诊科电话" value="{{addOrgMsg.emergencyNo}}" v-model="addOrgMsg.emergencyNo" :disabled="disabledIsShow" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">联系电话:</label>
                                            <input name="contactNo" type="text" class="form-control" id="exampleInputName2" placeholder="请输入联系电话" value="{{addOrgMsg.contactNo}}" v-model="addOrgMsg.contactNo" :disabled="disabledIsShow" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">医院网址:</label>
                                            <input name="homepage" type="text" class="form-control" id="exampleInputName2" placeholder="如：http://www.zsph.com" value="{{addOrgMsg.homepage}}" v-model="addOrgMsg.homepage" :disabled="disabledIsShow" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2" class="list-top-title">机构介绍:</label>
                                            <textarea name="description" value="{{addOrgMsg.description}}" v-model="addOrgMsg.description" class="form-control sim-explain-textarea" placeholder="请输入机构的相关介绍等" :disabled="disabledIsShow">{{addOrgMsg.description}}</textarea>
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2" class="list-top-title"><span class="start">*</span>交通说明:</label>
                                            <textarea name="trafficDesc" value="{{addOrgMsg.trafficDesc}}" v-model="addOrgMsg.trafficDesc" class="form-control sim-explain-textarea" placeholder="说明交通信息" :disabled="disabledIsShow" id="trafficExplain">{{addOrgMsg.trafficDesc}}</textarea>
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">邮编:</label>
                                            <input name="postcode" type="text" class="form-control" id="exampleInputName2" placeholder="请输入邮编" value="{{addOrgMsg.postcode}}" v-model="addOrgMsg.postcode" :disabled="disabledIsShow" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">传真:</label>
                                            <input name="fax" type="text" class="form-control" id="exampleInputName2" placeholder="请输入传真号码" value="{{addOrgMsg.fax}}" v-model="addOrgMsg.fax" :disabled="disabledIsShow" />
                                        </div>
                                        <div class="modal-footer">
                                            <div class="btn-opera">
                                                <div class="form-group form-group-foot" v-show="addOperaEvent">
                                                    <button type="submit" class="btn btn-default save-btn" @click.stop.prevent="confirmAddHspEvent">保 存</button>
                                                    <button class="btn btn-default cancel-btn" @click.stop.prevent="cancelAddHspEvent">取 消</button>
                                                </div>
                                                <div class="form-group form-group-foot" v-show="watchEditOpera">
                                                    <button type="button" class="btn btn-default save-btn" v-if="nowEditShow" @click.stop.prevent="editHspMsgEvent">编 辑</button>
                                                    <button type="button" class="btn btn-default save-btn" v-if="nowSaveShow" @click.stop.prevent="confirmSaveHspMsgEvent">保 存</button>
                                                    <button class="btn btn-default cancel-btn" @click.stop.prevent="cancelEditHspEvent">取 消</button>
                                                </div>
                                            </div>
                                        </div>
                                </div>
                                <!--账户信息-->
                                <div class="account-content" v-show="accountMsg">
                                    <div class="form-group clear-margin-bot del-cover text-right">
                                        <button type="button" class="save-btn" @click.stop.prevent="saveAccountMsgEvent">保存</button>
                                        <button type="button" class="cancel-btn" data-dismiss="modal">取消</button>
                                    </div>
                                    <form action="#" class="form-inline" id="account-message" enctype="multipart/form-data">
                                        <!-- 支付宝账户 -->
                                        <h2 class="account-title">支付宝</h2>
                                        <div class="form-group">
                                            <label for="exampleInputName2">支付宝账号:</label>
                                            <input name="account" type="text" class="form-control" placeholder="支付宝账号" value="{{AliPay.account}}" v-model="AliPay.account" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">合作者身份(PID):</label>
                                            <input name="partnerId" type="text" class="form-control" placeholder="合作者身份(PID)" value="{{AliPay.partnerId}}" v-model="AliPay.partnerId" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">商户私钥(privetaKey):</label>
                                            <input name="privateKey" type="text" class="form-control" placeholder="商户私钥(privetaKey)" value="{{AliPay.privateKey}}" v-model="AliPay.privateKey" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">Appid:</label>
                                            <input name="appId" type="text" class="form-control" placeholder="Appid" value="{{AliPay.appId}}" v-model="AliPay.appId" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">AliPublicKey:</label>
                                            <input name="aliPublicKey" type="text" class="form-control" placeholder="AliPublicKey" value="{{AliPay.aliPublicKey}}" v-model="AliPay.aliPublicKey" />
                                            <span class="explains">开放平台秘钥管理，查看支付宝公钥</span>
                                        </div>
                                        <!-- 微信账户 -->
                                        <h2 class="account-title">微信</h2>
                                        <div class="form-group">
                                            <label for="exampleInputName2">微信账号:</label>
                                            <input name="account" type="text" class="form-control" placeholder="微信账号" value="{{wechatPay.account}}" v-model="wechatPay.account" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">合作商户ID(partnerId):</label>
                                            <input name="partnerId" type="text" class="form-control" placeholder="合作商户ID(partnerId)" value="{{wechatPay.partnerId}}" v-model="wechatPay.partnerId" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">商户私钥(privetaKey):</label>
                                            <input name="privateKey" type="text" class="form-control" placeholder="商户私钥(privetaKey)" value="{{wechatPay.privateKey}}" v-model="wechatPay.privateKey" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">Appid:</label>
                                            <input name="appId" type="text" class="form-control" placeholder="Appid" value="{{wechatPay.appId}}" v-model="wechatPay.appId" />
                                        </div>
                                        <!-- 银联账户 -->
                                        <h2 class="account-title">银联</h2>
                                        <div class="form-group">
                                            <label for="exampleInputName2">银行卡号:</label>
                                            <input name="account" type="text" class="form-control" placeholder="银行卡号" value="{{bankPay.account}}" v-model="bankPay.account" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">商户ID:</label>
                                            <input name="partnerId" type="text" class="form-control" placeholder="商户ID" value="{{bankPay.partnerId}}" v-model="bankPay.partnerId" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">商户私钥(privetaKey):</label>
                                            <input name="privateKey" type="file" class="form-control" id="file" placeholder="+ 选择文件" />
                                            <!-- <file-upload-btn :imgurl="bankPay.filerurl" :uploadfilename="bankPay.uploadfilename"></file-upload-btn> -->
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">私钥密码:</label>
                                            <input name="bankPay.privateKey" type="text" class="form-control" placeholder="私钥密码" value="{{bankPay.privateKey}}" v-model="bankPay.privateKey" />
                                        </div>
                                        <!--中福-->
                                        <h2 class="account-title">中福统一支付平台账号配置</h2>
                                        <div class="form-group">
                                            <label for="exampleInputName2">收款商户名:</label>
                                            <input name="orgFullName" type="text" class="form-control" placeholder="收款商户名" v-model="ZhongFu.account" />
                                            <span class="explains">收款商户名、商户号由中福支付统一提供</span>
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">收款商户号:</label>
                                            <input name="orgFullName" type="text" class="form-control" placeholder="收款商户号" v-model="ZhongFu.partnerId" />
                                        </div>
                                    </form>
                                </div>
                                </form>
                            </div>
                        </div>
                        <!-- /.modal-content -->
                    </div>
                    <!-- /.modal-dialog -->
                </div>
                <!-- /.modal -->
            </div>
            <!--二维码-->
            <div id="ewmimg" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <div class="list-tips breadcrumb">
                                <span class="default-span">({{codeName_QR}})二维码</span>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span></button>
                            </div>
                        </div>
                        <div class="modal-body cbafter">
                            <div class="imgmodal">
                                <img src="" alt="后台暂无数据返回………………" id="ewm" />
                            </div>
                        </div>
                        <div class="modal-footer">
                        </div>
                    </div>
                </div>
            </div>
            <!-- 删除提示 -->
            <div id="delCoverTips" class="modal fade" tabindex="-1" role="dialog">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title">机构删除</h4>
                        </div>
                        <div class="modal-body">
                            <p class="del-tips">您确定要删除此"<span v-text="delOrgName"></span>"机构吗？</p>
                        </div>
                        <div class="modal-footer">
                            <div class="form-group clear-margin-bot del-cover">
                                <button type="button" class="save-btn" @click.stop.prevent="confirmDeleteOrg">确认</button>
                                <button type="button" class="cancel-btn" data-dismiss="modal">取消</button>
                            </div>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
            <!-- /.modal -->
        </div>
        <!-- 内容区 -->
    </div>
    </div>
</template>
<script>
import 'assets/reset.css';
import 'assets/lib/bootstrap-3.3.2/css/bootstrap.min.css';
import 'assets/lib/bootstrap-3.3.2/js/bootstrap.min.js';
import Header from 'components/module-head.vue';
import Asider from 'components/menu-list.vue';
import footerPage from 'components/BootPage.vue';
import areaPlugin from 'components/area-comp-org.vue';
import ImgUploadBtn from 'components/ImgUploadBtn.vue'
// import FileUploadBtn from 'components/FileUploadBtn.vue'
import Public from 'assets/public.js'

export default {
    data() {
            return {
                headersparam: {
                    'X-Service-Id': 'base.sysOrganizationService',
                    'X-Service-Method': 'list'
                },
                param: {
                    name: '',
                    pageNo: 1,
                    pageSize: 10
                },

                //字典查询数据
                dictionary: {
                    orgClassify: {}, //机构分类base_organizationType
                    orgNature: {}, //机构性质base_mechanismProperties
                    orgLevel: {}, //机构等级base_organizationGrade
                },

                //图像地址
                imgurl: '',

                //基本信息--账号信息
                baseMsg: true,
                accountMsg: false,

                //获取地区返回的文件树数据
                getAreaTreeData: [],
                //相应操作标题
                operaTiele: '',
                //机构标题
                orgTitle: '',
                //图片地址(上传预览)
                defaultUploadImg: '',
                serverData: {},
                //机构管理
                isOrgManage: true,
                //查看机构--添加机构(导航树)
                isWatchOrg: false,
                isAddOrg: false,
                //查看机构--添加机构(内容列表)
                isCheckOrg: false,
                //添加--机构相关信息(校验)
                addOrgMsg: {
                    orgId: "", //机构Id,新增时候不传
                    consultNo: "", //咨询电话
                    orgFullName: "", //机构全称
                    fax: "", //传真
                    orgAddress: "", //机构地址
                    orgShortName: "", //简称
                    street: "", //街道编码
                    emergencyNo: "", //紧急电话
                    medicalOrgId: "", //机构医保局id
                    postcode: "", //邮政编码
                    localOrgId: "", //机构代码
                    city: "", //地址（市）
                    avatarField: 2, //机构照片地址id
                    parentId: 0, //上级机构Id
                    orgNature: "", //机构性质
                    trafficDesc: "", //交通说明
                    province: "", //地址（省）
                    orgClassify: "", //机构分类
                    longitude: "", //经度
                    latitude: "", //维度
                    district: "", //地址（区、县）
                    orgLevel: "", //机构级别
                    parentOrgName: "",
                    description: '',
                    contactNo: '',
                    homepage: ''
                },

                //支付宝
                AliPay: {
                    aliPublicKey: "",
                    orgId: "",
                    appId: "",
                    privateKey: "",
                    partnerId: "",
                    accountType: "02",
                    account: "",
                    recordId: "" //新增时候不传
                },
                //微信
                wechatPay: {
                    aliPublicKey: "",
                    orgId: "",
                    appId: "",
                    privateKey: "",
                    partnerId: "",
                    accountType: "03",
                    account: "",
                    recordId: "" //新增时候不传
                },
                //银联
                bankPay: {
                    aliPublicKey: "",
                    orgId: "",
                    appId: "",
                    privateKey: "",
                    partnerId: "",
                    accountType: "04",
                    account: "",
                    recordId: "", //新增时候不传
                    // "filerurl":"" ,
                    // "uploadfilename":"" ,
                },
                //中福
                ZhongFu: {
                    orgId: "",
                    account: '',
                    partnerId: '',
                    accountType: '06'
                },

                //提交支付数据
                submitPayType: [],

                //机构二维码名字
                codeName_QR: '医院',

                //点击'添加'?'查看'
                addOperaEvent: false,
                watchEditOpera: false,
                //编辑？保存
                nowEditShow: true,
                nowSaveShow: false,
                //是否可以编辑
                disabledIsShow: 'disabled',
                //是否显示地区选择
                isSelArea: false,
                //要删除的机构名称-id
                delOrgName: '',
                delOrgId: '',

                //获取上级机构列表所有数据
                getParentIdData: {},
                // chronicid:"",//慢病ID 通过选取这个显示对应的监测目标
                search: {
                    orgs: [],
                    searchformdata: {
                        "name": "",
                        "orgId": "",
                        "pageNo": "1",
                        "pageSize": "10",
                        "orgFullName": ""
                    }
                },

                //是否有记录
                isData: false,
                //焦点
                isfocus: "",
                //是否显示地区
                showarea: true,

                //百度地图检索--关键字
                provinceIndex: '',
                cityIndex: '',
                areaIndex: '',
                streetIndex: '',

                //检索地址
                indexAddress: '',
                defaultarea: {
                    province: "",
                    city: "",
                    district: "",
                    street: "",
                },
            }
        },
        events: {
            'data': function(datas) {
                this.serverData = datas;
            },
            'areadata': function(areas) {
                this.addOrgMsg.province = areas.province;
                this.addOrgMsg.city = areas.city;
                this.addOrgMsg.district = areas.district;
                this.addOrgMsg.street = areas.street;
            },
            'serviceIconId': function(imgId) {
                this.addOrgMsg.avatarField = imgId;
            },
            //上传文件返回的数据
            // 'servicefileId' (data) {
            //     this.bankPay.privateKey = data
            // },
        },
        watch: {
            'serverData': 'isWatchServerData',
            'search.searchformdata.mainDoctorname': function(value, oldvalue) {
                if (value == "") {
                    this.search.searchformdata.mainDoctor = ""
                }
            }
        },
        ready() {
            var that = this;
            this.isData = (this.serverData.length == '' || null || 'undefined') ? true : false;
            $('#proviceIndex').on('change', function() {
                that.provinceIndex = $('#proviceIndex option:selected').text();
                // that.baiduMapIndex(that.provinceIndex);
            });
            $('#cityIndex').on('change', function() {
                that.cityIndex = $('#cityIndex option:selected').text();
                that.indexAddress = that.provinceIndex + that.cityIndex;
                // that.baiduMapIndex(that.indexAddress);
            });
            $('#areaIndex').on('change', function() {
                that.areaIndex = $('#areaIndex option:selected').text();
                that.indexAddress = that.provinceIndex + that.cityIndex + that.areaIndex;
                // that.baiduMapIndex(that.indexAddress);
            });
            $('#address').on('blur', function() {
                that.indexAddress = that.provinceIndex + that.cityIndex + that.areaIndex + that.addOrgMsg.orgAddress
                that.baiduMapIndex(that.indexAddress);
            });
            //字典请求
            this.dictionaryRequest();
            //获取上级机构列表所有数据
            this.requireParentId();
        },
        components: {
            //头部组件
            'header-component': Header,
            //侧部导航组件
            'aside-component': Asider,
            'bootpage-component': footerPage,
            'area-component': areaPlugin,
            'imgid-btn': ImgUploadBtn,
            // 'file-upload-btn':FileUploadBtn
        },
        methods: {
            //监听数据变化显示是否有记录
            isWatchServerData() {
                    if (this.serverData.length == '' || this.serverData.length == null || this.serverData.length == undefined) {
                        this.isData = true;
                    } else {
                        this.isData = false;
                    };
                },

                //字典请求
                dictionaryRequest() {
                    var that = this;
                    var arr = ["base.dictionary.base_organizationType", "base.dictionary.base_mechanismProperties", "base.dictionary.base_organizationGrade"];
                    $.when(Public.commonajax('coms.multipleDictionaryService', 'findDic', '[' + JSON.stringify(arr) + ']')).done(function(res) {
                        $.each(res.body, function(index, ele) {
                            if (ele.dicId == arr[0]) {
                                that.dictionary.orgClassify = ele.items;
                            }
                            if (ele.dicId == arr[1]) {
                                that.dictionary.orgNature = ele.items;
                            }
                            if (ele.dicId == arr[2]) {
                                that.dictionary.orgLevel = ele.items;
                            }
                        });
                    });
                },

                //上级机构--数据请求
                requireParentId() {
                    var that = this;
                    let parendIdDate = {
                        'name': '',
                        'pageNo': 1,
                        'pageSize': 10000
                    };
                    $.when(Public.commonajax('base.sysOrganizationService', 'list', '[' + JSON.stringify(parendIdDate) + ']')).done(function(res) {
                        if (res.code == 200) {
                            that.getParentIdData = res.body.list;
                            that.search.orgs = res.body.list;
                        };
                    });
                    // 搜索位置主管医生的下拉
                    $("#zhuguanyis").find('input').on('click', function(event) {
                        event.preventDefault();
                        event.stopPropagation();
                        $(".yishenglist").show();
                    });
                    $('#add-org-cover').find('.modal-content').on('click', function() {
                        $(".yishenglist").hide();
                    });
                },

                // 搜索中主管医生下拉框选中后赋值给input
                mayclick(item, event) {
                    if (item == undefined && event == undefined) {
                        this.addOrgMsg.parentId = "";
                        this.addOrgMsg.parentOrgName = ""
                    } else {
                        this.addOrgMsg.parentId = item.orgId;
                        this.addOrgMsg.parentOrgName = item.orgFullName

                    }
                    $(".yishenglist").hide();

                },

                //清除
                clearEvent() {
                    this.param.title = '';
                    this.$refs.page.refresh();
                },

                //搜索
                researchEvent() {
                    this.$refs.page.refresh();
                },

                //清空基本信息
                clearBaseMsgEvent() {
                    this.addOrgMsg.orgId = '';
                    this.addOrgMsg.consultNo = '';
                    this.addOrgMsg.orgFullName = '';
                    this.addOrgMsg.fax = '';
                    this.addOrgMsg.orgAddress = '';
                    this.addOrgMsg.orgShortName = '';
                    this.addOrgMsg.street = '';
                    this.addOrgMsg.emergencyNo = '';
                    this.addOrgMsg.medicalOrgId = '';
                    this.addOrgMsg.postcode = '';
                    this.addOrgMsg.localOrgId = '';
                    this.addOrgMsg.city = '';
                    this.addOrgMsg.avatarField = 0;
                    this.addOrgMsg.parentId = '';
                    this.addOrgMsg.orgNature = '';
                    this.addOrgMsg.trafficDesc = '';
                    this.addOrgMsg.province = '';
                    this.addOrgMsg.orgClassify = '';
                    this.addOrgMsg.longitude = '';
                    this.addOrgMsg.latitude = '';
                    this.addOrgMsg.district = '';
                    this.addOrgMsg.orgLevel = '';
                    this.addOrgMsg.parentOrgName = "";
                    this.addOrgMsg.description = "";
                    this.addOrgMsg.contactNo = '';
                    this.addOrgMsg.homepage = "";
                    this.imgurl = '';
                    this.$broadcast('imgurl', this.imgurl);
                },

                //添加医院机构
                addHospitalOrgEvent() {
                    this.operaTiele = '添加机构';
                    //机构标题
                    this.clearBaseMsgEvent();
                    this.defaultUploadImg = '';
                    //添加？查看？
                    this.addOperaEvent = true;
                    this.watchEditOpera = false;
                    this.disabledIsShow = false;
                    this.showarea = true;
                    this.baiduMap(116.331398, 39.897445);
                    $('#add-org-cover').modal('show');
                    //表单切换
                    this.baseMsg = true;
                    this.accountMsg = false;
                    this.defaultarea = {
                        province: "",
                        city: "",
                        district: "",
                        street: ""
                    }
                },

                //确认--添加
                confirmAddHspEvent() {
                    var that = this;
                    //校验--数据
                    var flag = this.validationForm();
                    console.log(that.addOrgMsg.parentOrgName);
                    //请求--判断
                    if (flag != false) {
                        $.when(Public.commonajax('base.sysOrganizationService', 'saveOrg', '[' + JSON.stringify(this.addOrgMsg) + ']')).done(function(res) {
                            if (res.code == 200 || res.code == 1) {
                                $('#add-org-cover').modal('hide');
                                Public.ajaxPrompt('保存成功！');
                                that.$refs.page.refresh();
                            } else {
                                let msg = res.msg.length > 30 ? '保存失败！' : res.msg;
                                Public.ajaxPrompt(msg);
                                return false;
                            };
                        });
                    } else {
                        this.disabledIsShow = false;
                        this.nowEditShow = false;
                        this.nowSaveShow = true;
                        setTimeout(function() {
                            $('#add-org-cover').modal('show');
                            $('#add-org-cover').css({
                                'overflow-y': 'scroll'
                            });
                        }, 1500);
                        return false;
                    };
                },

                //取消--添加
                cancelAddHspEvent() {
                    this.addOrgMsg.orgId = '';
                    this.addOrgMsg.qrCode = '';
                    this.addOrgMsg.qrAvatarFileId = '';
                    this.addOrgMsg.localOrgId = '';
                    this.addOrgMsg.fullName = '';
                    this.addOrgMsg.shortName = '';
                    this.addOrgMsg.classify = '';
                    this.addOrgMsg.district = '';
                    this.addOrgMsg.nature = '';
                    this.addOrgMsg.level = '';
                    this.addOrgMsg.mnemonic = '';
                    this.addOrgMsg.createDt = '';
                    this.addOrgMsg.lastModify = '';
                    this.addOrgMsg.source = '';
                    this.addOrgMsg.status = '';
                    $('#add-org-cover').modal('hide');
                },

                //查看--编辑机构（医院）
                watchAndEditEvent(lists) {
                    this.operaTiele = '查看机构';
                    this.baseMsg = true;
                    this.accountMsg = false;

                    //添加？查看？
                    // this.showarea=false;
                    this.addOperaEvent = false;
                    this.watchEditOpera = true;
                    this.nowEditShow = true;
                    this.nowSaveShow = false;
                    this.isSelArea = false;
                    this.defaultUploadImg = '';
                    // $('#add-hsp-org-form')[0].reset();
                    $('#add-org-cover').modal('show');
                    //根据经纬度来渲染地图定位
                    this.baiduMap(lists.longitude, lists.latitude);

                    //已有数据展示
                    var that = this;
                    $.when(Public.commonajax('base.sysOrganizationService', "getDetail", '["' + lists.orgId + '"]')).done(function(res) {
                        that.addOrgMsg = res.body;
                        that.imgurl = Public.IMGVIEW_URL() + res.body.avatarField;
                        that.defaultarea = {
                            province: that.addOrgMsg.province,
                            city: that.addOrgMsg.city,
                            district: that.addOrgMsg.district,
                            street: that.addOrgMsg.street
                        }
                    });

                    this.disabledIsShow = 'disabled';
                    $('#add-org-cover').modal('show');
                },

                //查看--编辑机构--编辑(可编辑状态)
                editHspMsgEvent() {
                    //机构标题
                    this.operaTiele = '编辑机构';
                    this.disabledIsShow = false;
                    this.nowEditShow = false;
                    this.nowSaveShow = true;
                },

                //查看--编辑机构--保存
                confirmSaveHspMsgEvent() {

                    //$('#add-org-cover').modal('show');
                    this.disabledIsShow = 'disabled';
                    this.nowEditShow = true;
                    this.nowSaveShow = false;
                    this.confirmAddHspEvent();
                },

                //查看--编辑机构--取消
                cancelEditHspEvent() {
                    this.disabledIsShow = 'disabled';
                    this.nowEditShow = true;
                    this.nowSaveShow = false;
                    $('#add-org-cover').modal('hide');
                },

                //医院导航
                hspNagationEvent(lists) {
                    location.href = './orgnavigation.html?id=' + lists.orgId;
                },

                //账号信息
                accountMsgEvent(lists) {
                    this.operaTiele = '账号信息';
                    //表单切换
                    this.baseMsg = false;
                    this.accountMsg = true;
                    $('#add-org-cover').modal('show');
                    var that = this;
                    $.when(Public.commonajax('base.sysOrganizationService', 'queryOrgPayInfo', '["' + lists.orgId + '"]')).done(function(res) {
                        if (res.body.length < 1) {
                            that.AliPay = {
                                'aliPublicKey': "",
                                'orgId': lists.orgId,
                                'appId': "",
                                'privateKey': "",
                                'partnerId': "",
                                'accountType': "02",
                                'account': "",
                                'recordId': ""
                            };
                            that.wechatPay = {
                                'aliPublicKey': "",
                                'orgId': lists.orgId,
                                'appId': "",
                                'privateKey': "",
                                'partnerId': "",
                                'accountType': "03",
                                'account': "",
                                'recordId': ""
                            };
                            that.bankPay = {
                                'aliPublicKey': "",
                                'orgId': lists.orgId,
                                'appId': "",
                                'privateKey': "",
                                'partnerId': "",
                                'accountType': "04",
                                'account': "",
                                'recordId': "",
                            };
                            that.ZhongFu = {
                                'orgId': lists.orgId,
                                'account': '',
                                'partnerId': '',
                                'accountType': '06'
                            };
                            return false;
                        };
                        $.each(res.body, function(index, ele) {
                            if (ele.accountType == '02') {
                                that.AliPay = ele;
                                //return false;
                            };
                            if (ele.accountType == '03') {
                                that.wechatPay = ele;
                                //return false;
                            };
                            if (ele.accountType == '04') {
                                that.bankPay = ele;
                                //return false;
                            };
                            if (ele.accountType == '06') {
                                that.ZhongFu = ele;
                                //return false;
                            };
                        });
                    });
                    //赋值机构id
                    this.AliPay.orgId = lists.orgId;
                    this.wechatPay.orgId = lists.orgId;
                    this.bankPay.orgId = lists.orgId;
                    this.ZhongFu.orgId = lists.orgId;
                },

                //保存账号信息
                saveAccountMsgEvent() {
                    var tag = this.accountValidation();
                    tag = tag.split(':');
                    //console.log(tag)字符型
                    if (tag[0] == 'false') {
                        Public.ajaxPrompt('支付宝账户所有项目为必填！');
                        return false;
                    };
                    if (tag[1] == 'false') {
                        Public.ajaxPrompt('微信账户所有项目为必填！');
                        return false;
                    };
                    if (tag[2] == 'false') {
                        Public.ajaxPrompt('银联账户所有项目为必填！');
                        return false;
                    };
                    if (tag[3] == 'false') {
                        Public.ajaxPrompt('中福账户所有项目为必填！');
                        return false;
                    };
                    $.when(Public.commonajax('base.sysOrganizationService', 'saveOrgPayInfo', '[' + JSON.stringify(this.submitPayType) + ']')).done((res) => {
                        if (res.code == 200) {
                            $('#add-org-cover').modal('hide');
                            Public.ajaxPrompt('保存成功！');
                        } else {
                            let msg = res.msg.length > 30 ? '保存失败！' : res.msg;
                            Public.ajaxPrompt(msg);
                        };
                    });
                },

                //报告说明
                hspReportEvent(lists) {
                    location.href = './orgReport.html?orgId=' + lists.orgId;
                },

                //查看二维码
                watchQrCodeEvent(qrCode) {
                    this.codeName_QR = qrCode.orgFullName;
                    $.when(Public.commonajax('base.sysOrganizationService', "qrAvatarFileId", '["' + qrCode.orgId + '"]')).done(function(res) {
                        $("#ewm").attr("src", Public.IMGVIEW_URL() + res.body);
                    });
                    $("#ewmimg").modal("show");
                },

                //删除机构
                deleteOrgEvent(lists) {
                    this.delOrgName = lists.orgFullName;
                    this.delOrgId = lists.orgId;
                    $('#delCoverTips').modal('show');
                },

                //确认--删除机构
                confirmDeleteOrg() {
                    var that = this;
                    $('#delCoverTips').modal('hide');
                    $.when(Public.commonajax('base.sysOrganizationService', 'deleteOrg', '["' + this.delOrgId + '"]')).done(function(resss) {
                        if (resss.code == 200) {
                            that.$refs.page.refresh();
                            Public.ajaxPrompt('删除成功！');
                        } else {
                            Public.ajaxPrompt('删除失败，请联系管理员！');
                        };
                    });
                },

                //图像预览
                imgSayPrevious(event) {
                    var that = this;
                    var img = $('.imgpres');
                    var ipt = $('.my-files');
                    var file = event.target.files[0];
                    var reader = new FileReader();
                    reader.readAsDataURL(file);
                    reader.onload = function(event) {
                        that.defaultUploadImg = event.target.result;
                    };
                },

                //百度地图(经纬度)
                baiduMap(longs, latati) {
                    longs = longs == '' ? 116.404 : longs;
                    latati = latati == '' ? 39.915 : latati;
                    //console.log(longs+':'+latati);
                    var that = this;
                    setTimeout(function() {
                        // 创建Map实例,设置地图允许的最小/大级别
                        var map = new BMap.Map("allmap");
                        map.centerAndZoom(new BMap.Point(longs, latati), 12);
                        map.enableScrollWheelZoom(true);
                        map.addControl(new BMap.MapTypeControl()); //添加地图类型控件
                        let new_point = new BMap.Point(longs, latati);
                        let marker = new BMap.Marker(new_point); // 创建标注
                        map.addOverlay(marker); // 将标注添加到地图中
                        // map.panTo(new_point);
                        //单击获取点击的经纬度
                        map.addEventListener("click", function(e) {
                            that.addOrgMsg.longitude = e.point.lng;
                            that.addOrgMsg.latitude = e.point.lat;
                            map.clearOverlays();
                            let new_point = new BMap.Point(e.point.lng, e.point.lat);
                            let marker = new BMap.Marker(new_point); // 创建标注
                            map.addOverlay(marker);
                        });
                    }, 200);
                },

                //百度地图检索(关键字)
                baiduMapIndex(indexAdd) {
                    var that = this;
                    //检索
                    var map = new BMap.Map("allmap");
                    //map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
                    var local = new BMap.LocalSearch(map, {
                        renderOptions: {
                            map: map
                        }
                    });
                    map.enableScrollWheelZoom(true);
                    //获取经纬度
                    map.clearOverlays(); //清空原来的标注
                    local.setSearchCompleteCallback(function(searchResult) {
                        var poi = searchResult.getPoi(0);
                        that.addOrgMsg.longitude = poi.point.lng;
                        that.addOrgMsg.latitude = poi.point.lat;
                        map.centerAndZoom(poi.point, 13);
                        var marker = new BMap.Marker(new BMap.Point(poi.point.lng, poi.point.lat)); // 创建标注，为要查询的地址对应的经纬度
                        map.addOverlay(marker);
                        marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
                    });
                    local.search(indexAdd);
                    //map.click
                    map.addEventListener("click", function(e) {
                        that.addOrgMsg.longitude = e.point.lng;
                        that.addOrgMsg.latitude = e.point.lat;
                        map.clearOverlays();
                        let new_point = new BMap.Point(e.point.lng, e.point.lat);
                        let marker = new BMap.Marker(new_point); // 创建标注
                        map.addOverlay(marker);
                    });
                },

                //表单验证
                validationForm() {
                    var fullName = $("#fullName").val();
                    var provice = $("#provice").val();
                    var city = $("#city").val();
                    var address = $("#address").val();
                    var longitude = $("#longitude").val();
                    var latitude = $("#latitude").val();
                    var trafficExplain = $("#trafficExplain").val();
                    var localOrgId = this.addOrgMsg.localOrgId;
                    if (fullName == '' || fullName == undefined) {
                        Public.ajaxPrompt('机构全称不能为空！');
                        return false;
                    }
                    if (/^[0-9a-zA-Z]+$/g.test(localOrgId) != true) {
                        Public.ajaxPrompt('机构代码只能是数字或字母！');
                        return false;
                    }
                    if (provice == '' || city == '') {
                        Public.ajaxPrompt('所在地区不能为空！');
                        return false;
                    }
                    if (address == '' || address == undefined) {
                        Public.ajaxPrompt('机构地址不能为空！');
                        return false;
                    }
                    if (trafficExplain == '' || trafficExplain == undefined) {
                        Public.ajaxPrompt('交通说明不能为空！');
                        return false;
                    }
                    var expReg = /([0-9]{3,4}-)?[0-9]{7,8}/;
                    var expRegUrl = new RegExp('^(((ht|f)tp(s?))\://)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&amp;%\$#\=~_\-]+))*$');
                    var longitudeExp = /^[-]?(\d|([1-9]\d)|(1[0-7]\d)|(180))(\.\d*)?$/g;
                    var latitudeExp = /^[-]?(\d|([1-8]\d)|(90))(\.\d*)?$/g;
                    if (this.addOrgMsg.consultNo != '') {
                        if (expReg.test(this.addOrgMsg.consultNo) == false) {
                            Public.ajaxPrompt('咨询电话填写格式有误！');
                            return false;
                        }
                    };
                    if (this.addOrgMsg.emergencyNo != '') {
                        if (expReg.test(this.addOrgMsg.emergencyNo) == false) {
                            Public.ajaxPrompt('急诊科电话格式填写有误！');
                            return false;
                        }
                    };
                    if (this.addOrgMsg.contactNo != '') {
                        if (expReg.test(this.addOrgMsg.contactNo) == false) {
                            Public.ajaxPrompt('联系电话填格式写有误！');
                            return false;
                        }
                    };
                    if (this.addOrgMsg.homepage != '') {
                        if (expRegUrl.test(this.addOrgMsg.homepage) == false) {
                            Public.ajaxPrompt('网址格式填写有误！');
                            return false;
                        }
                    };
                    if (this.addOrgMsg.postcode != '') {
                        if (/^[0-9]{6}$/.test(this.addOrgMsg.postcode) == false) {
                            Public.ajaxPrompt('邮编格式填写有误！');
                            return false;
                        }
                    };
                    if (this.addOrgMsg.fax != '') {
                        if (/^(\d{3,4}-)?\d{7,8}$/.test(this.addOrgMsg.fax) == false) {
                            Public.ajaxPrompt('传真格式填写有误！');
                            return false;
                        }
                    };
                    if (longitudeExp.test(longitude) == false || longitude == '') {
                        Public.ajaxPrompt('经度坐标范围为 -180 ~ 180');
                        return false;
                    }
                    if (latitudeExp.test(latitude) == false || latitude == '') {
                        Public.ajaxPrompt('纬度坐标范围为 -90 ~ 90 ');
                        return false;
                    }
                    return true;
                },

                //账号信息验证
                accountValidation() {
                    var that = this;
                    var saveMsgArray = [];
                    //支付宝
                    var flag_Ali = (this.AliPay.account != '') || (this.AliPay.partnerId != '') || (this.AliPay.privateKey != '') || (this.AliPay.appId != '') || (this.AliPay.aliPublicKey != '');
                    if (flag_Ali == true) {
                        var flag_AliPay = (this.AliPay.account != '') && (this.AliPay.partnerId != '') && (this.AliPay.privateKey != '') && (this.AliPay.appId != '') && (this.AliPay.aliPublicKey != '');
                        if (flag_AliPay == false) {
                            flag_Ali = false
                        } else {
                            saveMsgArray.push(this.AliPay);
                        };
                    } else {
                        flag_Ali = true;
                    };

                    //微信
                    var flag_Wei = (this.wechatPay.account != '') || (this.wechatPay.partnerId != '') || (this.wechatPay.privateKey != '') || (this.wechatPay.appId != '');
                    if (flag_Wei == true) {
                        var flag_WeiPay = (this.wechatPay.account != '') && (this.wechatPay.partnerId != '') && (this.wechatPay.privateKey != '') && (this.wechatPay.appId != '');
                        if (flag_WeiPay == false) {
                            flag_Wei = false
                        } else {
                            saveMsgArray.push(this.wechatPay);
                        };
                    } else {
                        flag_Wei = true;
                    };

                    //银联
                    var flag_Bank = (this.bankPay.account != '') || (this.bankPay.partnerId != '') || (this.bankPay.privateKey != '');
                    if (flag_Bank == true) {
                        var flag_BankPay = (this.bankPay.account != '') && (this.bankPay.partnerId != '') && (this.bankPay.privateKey != '');
                        if (flag_BankPay == false) {
                            flag_Bank = false
                        } else {
                            saveMsgArray.push(this.bankPay);
                        };
                    } else {
                        flag_Bank = true;
                    };

                    //中福
                    var flag_ZhongFu = (this.ZhongFu.account != '') || (this.ZhongFu.partnerId != '');
                    if (flag_ZhongFu == true) {
                        var flag_ZFPay = (this.ZhongFu.account != '') && (this.ZhongFu.partnerId != '');
                        if (flag_ZFPay == false) {
                            flag_ZhongFu = false
                        } else {
                            saveMsgArray.push(this.ZhongFu);
                        };
                    } else {
                        flag_ZhongFu = true;
                    };
                    let boolenVal = flag_Ali + ':' + flag_Wei + ':' + flag_Bank + ':' + flag_ZhongFu;
                    this.submitPayType = saveMsgArray;
                    return boolenVal;
                }
        } //methods
}
</script>
